package com.ldk.framework.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;

import com.ldk.base.framework.dao.impl.BaseDAO;
import com.ldk.base.framework.util.SystemUtil;
import com.ldk.framework.dao.IPhoneValidcodeDAO;
import com.ldk.framework.entity.PhoneValidcode;

/**
* PhoneValidcodeDAO接口实现类
* @author xiangwl
*/
@Repository
public class PhoneValidcodeDAO extends BaseDAO<PhoneValidcode> implements IPhoneValidcodeDAO {
	public Boolean scheduleExpired(String dbKey, int timeout) {
		Assert.notNull(timeout);
		Map<String, Object> parms = new HashMap<String, Object>();
		parms.put("timeout", timeout);
		parms.put("currentTime", SystemUtil.getAllSeconds());
		
		SqlSession sqlSession = getSqlSession(dbKey);
		
	    int row = sqlSession.update(getSqlName("scheduleExpired"), parms);
	    
	    return row > 0;
	}
}
